struct _GskTransform
{
const GskTransformClass *transform_class;
-
- volatile int ref_count;
+
GskTransformCategory category;
GskTransform *next;
};
g_return_val_if_fail (transform_class != NULL, NULL);
- self = g_malloc0 (transform_class->struct_size);
+ self = g_atomic_rc_box_alloc0 (transform_class->struct_size);
self->transform_class = transform_class;
- self->ref_count = 1;
self->category = next ? MIN (category, next->category) : category;
self->next = gsk_transform_is_identity (next) ? NULL : next;
self->transform_class->finalize (self);
gsk_transform_unref (self->next);
-
- g_free (self);
}
/**
if (self == NULL)
return NULL;
- g_atomic_int_inc (&self->ref_count);
-
- return self;
+ return g_atomic_rc_box_acquire (self);
}
/**
if (self == NULL)
return;
- if (g_atomic_int_dec_and_test (&self->ref_count))
- gsk_transform_finalize (self);
+ g_atomic_rc_box_release_full (self, (GDestroyNotify) gsk_transform_finalize);
}
/**